﻿using System;
using System.ComponentModel;
using System.Runtime.Serialization;
using nRoute.Components;

namespace nRoute.Samples.OfficerXcel.Model
{
    [DataContract]
    public class AuthorInfo
        : INotifyPropertyChanged
    {
        private string _name;
        private string _initials;

#region Properties

        [DataMember]
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                if (!string.Equals(_name, value, StringComparison.InvariantCulture))
                {
                    _name = value;
                    PropertyChanged.Notify(() => Name);
                }
            }
        }

        [DataMember]
        public string Initials
        {
            get
            {
                return _initials;
            }
            set
            {
                if (!string.Equals(_initials, value, StringComparison.InvariantCulture))
                {
                    _initials = value;
                    PropertyChanged.Notify(() => Initials);
                }
            }
        }

#endregion

#region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

#endregion

    }
}
